<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>第二节课</title>
		<style type="text/css">
			*{
				padding: 0;
				margin: 0;
			}
			.container {
				width: 100vw;
				height: 100vh;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			canvas {
				width: 500px;
				height: 500px;
				border: 2px solid blue;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<canvas id="canvas" width="500" height="500"></canvas>
		</div>
	</body>
	<script>
		window.onload = function(){
			let oCanvas = document.getElementById('canvas');
			
			console.dir(oCanvas);
			
			let oPen = oCanvas.getContext("2d");
			
			console.dir(oPen);
			
			//线的粗细
			oPen.strokeStyle="#0000FF";
			oPen.lineWidth = 6;
			oPen.beginPath();
			oPen.moveTo(250,110);
			oPen.quadraticCurveTo(50,40,250,250);
			oPen.moveTo(250,110);
			oPen.quadraticCurveTo(450,40,250,250);
			oPen.stroke();
		}
	</script>
</html>
